/*
 * =====================================================================================
 *
 *       Filename:  exp2.c
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  Friday 05 August 2011 09:15:40  IST
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Dilawar Singh (Graduate Student, EE IITB), dilawar@ee.iitb.ac.in
 *      Institute:  IIT Bombay
 *
 * =====================================================================================
 */


#include	<stdio.h>
#include	<stdlib.h>

#define o mems++ 
#define oo mems+=2
#define ooo mems+=3
#define oooo mems+=4
#define addr_(p) ((addr)(size_t)(p))
#define node_(a) ((node*)(size_t)(a))
#define page_(a) ((page*)(size_t)(a))


#define logPageSize 12
#define memSize (1<<29)
#define pageSize (1<<logPageSize)
#define pageInts (pageSize/sizeof(int))
#define pageMask (pageSize-1)



typedef unsigned int addr;

typedef struct node_struct {
  addr lo,hi;
  int xref; /* reference count minus one */
  unsigned int index; /* variable ID followed by random bits */
} node;

typedef struct page_struct {
  addr dat[pageInts];
} page;  

node *botSink, *topSink;
node *pNode;
page *pPage;

long long mems = 9999, rmems, zmems;
char mem[200];

int main()
{

    printf("memSize %d\n", memSize);
    botSink = (node*) mem;
    printf("mems : %lld\n", mems);
    o, botSink -> lo=botSink -> hi=addr_(botSink);
    printf("mems1 : %lld\n", mems);
    printf("botSink->lo and botSink : %d, %d\n", (int)botSink->lo, (int)addr_(botSink));
    return 0;
}
